#ifndef CONFIGVIEW_H
#define CONFIGVIEW_H

#include <QWidget>
#include "configdata.h"
#include "configcontroller.h"
#include "genmanitem.h"
#include "interfaces.h"
#include "timesettingwid.h"

class ConfigView : public QWidget, public ConfigObserver
{
    Q_OBJECT
public:
    ConfigView(ConfigData *data, QWidget *parent = 0);
    ~ConfigView();
    void Initialize();
    void SetupUI();
    void addGen(int genId);
	void addGen(int genId, const TGenConfig& config);
    void delGen(int genId);
	void update();

private:
    ConfigData *m_configData;
    ConfigControllerInterface *m_configController;
    QListWidget *tranList;
    QListWidget *genList;
	TimeSettingWid *timeSetting;
	QLineEdit *ipLineEdit; 
	QLineEdit *updateLineEdit; 

signals:

public slots:
    void CheckHandle(int type, bool state);
    void RatioHandle(int type, int ratio);
    void DurationHandle(int sec);
    void UserHandle(int user);
    void TimeHandle(int time);
    void AddGenHandle();
    void DelGenHandle(int genId);
    void GenConfigHandle(int genId, const TGenConfig& config);
	void SetServerIPHandle();
	void SetUpdateRateHandle();
};

#endif // CONFIGVIEW_H
